import request from '@/utils/request';

//批量删除课件
export const deleteQuestion = (list) => {
    return request({
        url: '/eduM2/eduQuestion/deleteQuestion',
        method: 'post',
        data: list
    })
}

//新增题目
export const addQuestion = (row) => {
    return request({
        url: '/eduM2/eduQuestion/addQuestion',
        method: 'post',
        data: row
    })
}


//修改题目信息
export const updateQuestion = (row) => {
    return request({
        url: '/eduM2/eduQuestion/updateQuestion',
        method: 'post',
        data: row
    })
}

//查询试卷或题库的题目
export const queryQuestion = (testId) => {
    return request({
        url: '/eduM2/eduQuestion/showTest/' + testId,
        method: 'get',
    })
}

//查询小节题目
export const queryQuestionByChapter = (chapterId) => {
    return request({
        url: '/eduM2/eduQuestionChapter/getChapterQuestionByChapterId/' + chapterId,
        method: 'get',
    })
}

// 新增小节题目
export const addQuestionByChapter = (chapterId,ids) => {
    return request({
        url: '/eduM2/eduQuestionChapter/addChapterQuestion/'+ chapterId,
        method: 'post',
        data: ids
    })
}

// 移除小节题目
export const removeQuestionByChapter = (ids) => {
    return request({
        url: '/eduM2/eduQuestionChapter/deleteQuestionChapterByIds',
        method: 'post',
        data: ids
    })
}